<template>
  <div class="user-account">
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span>账户管理</span>
        </div>
      </template>
      <el-form :model="form" label-width="100px">
        <el-form-item label="用户名">
          <el-input v-model="form.username" disabled></el-input>
        </el-form-item>
        <el-form-item label="联系方式">
          <el-input v-model="form.contact"></el-input>
        </el-form-item>
        <el-form-item label="密码">
          <el-input type="password" v-model="form.password" show-password></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">保存</el-button>
        </el-form-item>
      </el-form>
    </el-card>
  </div>
</template>

<script>
export default {
  name: "UserAccount",
  data() {
    return {
      form: {
        username: 'exampleUser',
        contact: '',
        password: ''
      }
    };
  },
  methods: {
    onSubmit() {
      console.log('submit!', this.form);
      // 在这里添加保存数据到后端的逻辑
    }
  }
}
</script>

<style scoped>
.user-account {
  padding: 20px;
}
</style>